package com.auto.admin.service.impl;

import com.auto.admin.entity.ApiCategory;
import com.auto.admin.mapper.ApiCategoryMapper;
import com.auto.admin.service.ApiCategoryService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * @author liangshf
 * @Description: api自定义分类信息 服务实现类
 * @date 2018-06-20
 */
@Service
public class ApiCategoryServiceImpl extends ServiceImpl<ApiCategoryMapper, ApiCategory> implements ApiCategoryService {

	@Override
	public List<ApiCategory> findByTopId(Long pid){
		QueryWrapper<ApiCategory> wrapper = new QueryWrapper<>();
		wrapper.like("parent_ids", pid);
		wrapper.eq("type", 1);
		wrapper.eq("del", 0);
		return baseMapper.selectList(wrapper);
	}

	@Override
	public List<ApiCategory> findByPId(Long pid){
		QueryWrapper<ApiCategory> wrapper = new QueryWrapper<>();
		wrapper.eq("pid", pid);
		wrapper.eq("del", 0);
		return baseMapper.selectList(wrapper);
	}
	
}
